using System;
using System.Collections.Generic;
using System.Text;
using Index;

namespace Query
{
    public class Score
    {
        private TermFrequency freq;

        public Score(WikiIndex index)
        {
            freq = new TermFrequency(index);
        }

        public double Compute(string[] query, int document_id)
        {
            double sum = 0.0;
            if (query != null)
            {
                foreach (string term in query)
                {
                    sum += freq.Tf_IDf(term, document_id);
                }
            }
            return sum;
        }
    }
}
